<?php

namespace App\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;

enum OrderStatus: int implements HasLabel,HasColor,HasIcon
{
    case NO_PAY = 0;
    case HAS_PAY = 1;

    case HAS_COMPLETE = 2;

    case REFUND_ING = 3;
    case REFUND_END = 4;
    public function getLabel(): string
    {
        return match ($this) {
            self::NO_PAY => '未支付',
            self::HAS_PAY => '已支付',
            self::HAS_COMPLETE => '已完成',
            self::REFUND_ING => '申请退款',
            self::REFUND_END => '已退款'
        };
    }
    public function getColor(): string
    {
        return match ($this) {
            self::NO_PAY => 'danger',
            self::HAS_PAY => 'success',
            self::HAS_COMPLETE => 'primary',
            self::REFUND_ING => 'danger',
            self::REFUND_END => 'success'
        };
    }

    public function getIcon(): string
    {
        return match ($this) {
            self::NO_PAY => 'heroicon-o-clock',
            self::HAS_PAY => 'heroicon-o-shield-check',
            self::HAS_COMPLETE => 'heroicon-o-truck',
            self::REFUND_ING => 'heroicon-o-wrench',
            self::REFUND_END => 'heroicon-o-receipt-refund'
        };
    }

}
